<!--
 * @Date: 2025-01-29 21:27:49
 * @LastEditors: 贾二小 erxiao.jia@outlook.com
 * @LastEditTime: 2025-09-03 23:52:46
 * @FilePath: /admin-vue/src/App.vue
-->
<script setup lang="ts">
import { darkTheme } from 'naive-ui'
import { naiveDateLocales, naiveLocales } from '@/locales/naive'

const themeStore = useThemeStore()

const naiveDarkTheme = computed(() => (themeStore.darkMode ? darkTheme : undefined))

const appStore = useAppStore()
const naiveLocale = computed(() => {
  return naiveLocales[appStore.locale]
})

const naiveDateLocale = computed(() => {
  return naiveDateLocales[appStore.locale]
})
</script>

<template>
  <NConfigProvider
    :theme="naiveDarkTheme"
    inline-theme-disabled
    :locale="naiveLocale"
    :date-locale="naiveDateLocale"
  >
    <NGlobalStyle />
    <AppProvider>
      <n-el>
        <Suspense>
          <NLayout position="absolute"> <RouterView /> </NLayout>
        </Suspense>
      </n-el>
    </AppProvider>
  </NConfigProvider>
</template>

<style scoped></style>
